#include "GameApp.h"

CGameApp::CGameApp()
{

}

CGameApp::~CGameApp()
{
}

bool CGameApp::applicationDidFinishLaunching()
{
	CCDirector *pDirector = CCDirector::sharedDirector();
	pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
	pDirector->setDisplayStats(true);

	CCScene* pScene = CCScene::node();
	CCLayer* pLayer = CCLayer::node();
	CCSprite* pSprite = CCSprite::spriteWithFile("Resource/Hello.png");
	pSprite->setPosition(CCPoint(200,200));


	pLayer->addChild(pSprite);
	pScene->addChild(pLayer);
	pDirector->runWithScene(pScene);

	//pLayer->release();
	//pSprite->release();

	return true;
}

void CGameApp::applicationDidEnterBackground()
{
	 CCDirector::sharedDirector()->pause();
}

void CGameApp::applicationWillEnterForeground()
{
	CCDirector::sharedDirector()->resume();
}